<!doctype html>


<html>
<head>
  <link rel="shortcut icon" href="static/images/favicon.ico" type="image/x-icon">
  <title>bidi (Closure Library API Documentation - JavaScript)</title>
  <link rel="stylesheet" href="static/css/base.css">
  <link rel="stylesheet" href="static/css/doc.css">
  <link rel="stylesheet" href="static/css/sidetree.css">
  <link rel="stylesheet" href="static/css/prettify.css">

  <script>
     var _staticFilePath = "static/";
     var _typeTreeName = "goog";
     var _fileTreeName = "Source";
  </script>

  <script src="static/js/doc.js">
  </script>


  <meta charset="utf8">
</head>

<body onload="grokdoc.onLoad();">

<div id="header">
  <div class="g-section g-tpl-50-50 g-split">
    <div class="g-unit g-first">
      <a id="logo" href="index.html">Closure Library API Documentation</a>
    </div>

    <div class="g-unit">
      <div class="g-c">
        <strong>Go to class or file:</strong>
        <input type="text" id="ac">
      </div>
    </div>
  </div>
</div>





<div class="colmask rightmenu">
<div class="colleft">
    <div class="col1">
      <!-- Column 1 start -->

<div id="title">
       <span class="fn">style.bidi</span>
</div>

<hr/>


  <h2>Classes</h2>
   
<br/>

  <div class="legend">
        <span class="key publickey"></span><span>Public</span>
        <span class="key protectedkey"></span><span>Protected</span>
        <span class="key privatekey"></span><span>Private</span>
  </div>









<div class="section">
  <table class="horiz-rule">


  </table>
</div>




  <h2>Global Functions</h2>





<div class="section">
  <table class="horiz-rule">


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.style.bidi.getOffsetStart"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.style.bidi.</span><span class="entryName">getOffsetStart<span class="args">(<span class="arg">element</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the "offsetStart" of an element, analagous to offsetLeft but
normalized for right-to-left environments and various browser
inconsistencies. This value returned can always be passed to setScrollOffset
to scroll to an element's left edge in a left-to-right offsetParent or
right edge in a right-to-left offsetParent.

For example, here offsetStart is 10px in an LTR environment and 5px in RTL:

<pre class="lang-js prettyprint">
|          xxxxxxxxxx     |
 ^^^^^^^^^^   ^^^^   ^^^^^
    10px      elem    5px
</pre>

If an element is positioned before the start of its offsetParent, the
startOffset may be negative.  This can be used with setScrollOffset to
reliably scroll to an element:

<pre class="lang-js prettyprint">
var scrollOffset = goog.style.bidi.getOffsetStart(element);
goog.style.bidi.setScrollOffset(element.offsetParent, scrollOffset);
</pre>
     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">element</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/DOM/Element">Element</a></span>
        <div class="entryOverview">The element for which we need to determine the
    offsetStart position.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The offsetStart for that element.
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_style_bidi.js.source.html#line88">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.style.bidi.getScrollLeft"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.style.bidi.</span><span class="entryName">getScrollLeft<span class="args">(<span class="arg">element</span>)</span>
        </span>
        &#8658; <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
      </div>


     <div class="entryOverview">
       Returns the normalized scrollLeft position for a scrolled element.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">element</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/DOM/Element">Element</a></span>
        <div class="entryOverview">The scrolled element.</div>
     </td>
   </tr>
  </table>
      </div>
   
      <div class="detailsSection">
        <b>Returns:</b>&nbsp;<span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>&nbsp;
            The number of pixels the element is scrolled. 0 indicates
    that the element is not scrolled at all (which, in general, is the
    left-most position in ltr and the right-most position in rtl).
      </div>
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_style_bidi.js.source.html#line34">code &raquo;</a>
  </td>
     </tr>


     <tr class="even entry public">
       <td class="access"></td>






  <td>
    <a name="goog.style.bidi.setPosition"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.style.bidi.</span><span class="entryName">setPosition<span class="args">(<span class="arg">elem</span>,&nbsp;<span class="arg">left</span>,&nbsp;<span class="arg">top</span>,&nbsp;<span class="arg">isRtl</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the element's left style attribute in LTR or right style attribute in
RTL.  Also clears the left attribute in RTL and the right attribute in LTR.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">elem</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/DOM/Element">Element</a></span>
        <div class="entryOverview">The element to position.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">left</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The left position in LTR; will be set as right in RTL.</div>
     </td>
   </tr>
     
   <tr class="even">
     <td>
        <span class="entryName">top</span>
        : <span>?</span><span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The top position.  If null only the left/right is set.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">isRtl</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Boolean">boolean</a></span>
        <div class="entryOverview">Whether we are in RTL mode.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_style_bidi.js.source.html#line171">code &raquo;</a>
  </td>
     </tr>


     <tr class="odd entry public">
       <td class="access"></td>






  <td>
    <a name="goog.style.bidi.setScrollOffset"></a>


     <div class="arg">
       <img align="left" src="static/images/blank.gif">

        <span class="entryNamespace">goog.style.bidi.</span><span class="entryName">setScrollOffset<span class="args">(<span class="arg">element</span>,&nbsp;<span class="arg">offsetStart</span>)</span>
        </span>
      </div>


     <div class="entryOverview">
       Sets the element's scrollLeft attribute so it is correctly scrolled by
offsetStart pixels.  This takes into account whether the element is RTL and
the nuances of different browsers.  To scroll to the "beginning" of an
element use getOffsetStart to obtain the element's offsetStart value and then
pass the value to setScrollOffset.

     </div>


    <! -- Method details -->
    <div class="entryDetails">

      <div class="detailsSection">
        <b>Arguments: </b>






<table class="horiz-rule">
     
   <tr class="even">
     <td>
        <span class="entryName">element</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/DOM/Element">Element</a></span>
        <div class="entryOverview">The element to set scrollLeft on.</div>
     </td>
   </tr>
     
   <tr class="odd">
     <td>
        <span class="entryName">offsetStart</span>
        : <span class="type"><a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Number">number</a></span>
        <div class="entryOverview">The number of pixels to scroll the element.
    If this value is &lt; 0, 0 is used.</div>
     </td>
   </tr>
  </table>
      </div>
   
  
    </div>
   
  </td>


  <td class="view-code">
     <a href="local_closure_goog_style_bidi.js.source.html#line141">code &raquo;</a>
  </td>
     </tr>


  </table>
</div>



      <!-- Column 1 end -->
    </div>

        <div class="col2">
          <!-- Column 2 start -->
          <div class="col2-c">
            <h2 id="ref-head">Package style</h2>
            <div id="localView"></div>
          </div>

          <div class="col2-c">
            <h2 id="ref-head">Package Reference</h2>
            <div id="sideTypeIndex" rootPath="" current="style.bidi"></div>
          </div>
          <!-- Column 2 end -->
        </div>
</div>
</div>

</body>
</html>
